<?php

if(!empty($_POST)){
date_default_timezone_set('PRC');//
$t=time();
$today=date('Y-m-d H:i:s',$t);
include"conn.php";
$name=$_POST['name']; 
$content=$_POST['content'];
$sql="insert into  notes(name,content,addtime) value('$name','$content','$today')";
$rs=$mylink->query($sql);//$rs如果成功，rs为真   如果失败   rs为假
$sql="select max(id) as id from  notes";
$rs=$mylink->query($sql);//$rs如果成功，rs为真   如果失败   rs为假 
 $row=$rs->fetch_array();
 $id=$row['id'];
 
echo json_encode($_POST);
die;
}

$data=array("name"=>"abc","content"=>"123456");

echo json_encode($data);
